Type-specific arithmetic

A fixnum is an integer whose magnitude lies within an implementation-dependent range. This range is guaranteed to all integers which are acceptable as array, string, or vector indices. T guarantees that fixnums will have at least 24 bits. In T3.1, this range is the half-open interval
\begin{codexenv}
[2$^{\hbox{-29}}$,2$^{\hbox{29}}$). \\
\end{codexenv}

Type predicate


\begin{inset}{}
Returns true if {\it object\/} is a fixnum.
\end{inset}


\begin{inset}{}
Returns the largest integer value within the fixnum range. No in...
...ng true to {\tt FIXNUM?} is greater than {\tt MOST-POSITIVE-FIXNUM}.
\end{inset}


\begin{inset}{}
Returns the smallest integer value within the fixnum range. No i...
...E-FIXNUM) \\
($<$= {\it x\/} MOST-POSITIVE-FIXNUM))
\end{tabbing}}
\end{inset}

The following procedures are defined for performing type-restricted arithmetic. These procedures should be considered specializations of their corresponding generic arithmetic procedures. They assume restrictions on the types of their arguments and results. The prefix FX means ``fixnum-specific'' and FL means ``flonum-specific.'' For example,
\begin{codexenv}
(FX+ {\it x\/} {\it y\/}) \\
$\equiv$\ (ENFORCE FIXNUM? (+ (ENFORCE FIXNUM? {\it x\/}) (ENFORCE FIXNUM? {\it y\/})))
\end{codexenv}
T will implement calls to these type-specific procedures in a more efficient manner than calls to the corresponding generic procedures.

The following list catalogs the available routines. In most case the effect of the procedure should be analogous to the example above. The one exception is FX/, which is a specialization of the truncated (integer) division routine QUOTIENT, not of the division routine /.
\begin{codexenv}
\begin{tabular}{lll}
(FX+ {\it fixnum1 fixnum2\/}) &$\longrigh...
...ixnum\/}\index{FLONUM->FIXNUM@{\tt FLONUM->FIXNUM}}
\end{tabular} \end{codexenv}